package com.wsl.listener;

import com.wsl.Event.DemoEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * @Author:WangShuliang
 * @Description:  事件监听器   DemoEvent 为要监听的类
 * @Date:Created in 15:21 2017/11/24
 * @Modified by:
 */
@Component
public class DemoListener implements ApplicationListener<DemoEvent> {
    @Override
    public void onApplicationEvent(DemoEvent demoEvent) {
        String msg = demoEvent.getMsg();
        System.out.println("我(bean-demoListener)接收到了bean-demoPublisher发布的消息:"+msg);
    }
}